//
//  RootViewController.m
//  cellMaxMinDemo
//
//  Created by Sagar Kothari on 19/07/11.
//  Copyright 2011 SagarRKothari-iPhone. All rights reserved.
//

#import "ThreeDataViewController.h"
#import "ThreeDataViewCell.h"

#import "GTMBase64.h"
#import "NSDictionary+DataFormat.h"

@interface ThreeDataViewController()

@property (strong, nonatomic) NSMutableArray *dataArray;
@property (strong, nonatomic) NSDictionary *webviewDic;

@property (assign, nonatomic) ThreeDataStyle style;
@property (strong, nonatomic) NSString *treeData;
@property (strong, nonatomic) NSString *functionA;

@property (strong, nonatomic) NSMutableArray *threeArray;
@property (assign, nonatomic) BOOL isLocalData;

@property (strong, nonatomic) UIActivityIndicatorView *indicatoView;
@property (strong, nonatomic) UIButton *promptButton;
@property (strong, nonatomic) ServiceParametModel *para;

@end

@implementation ThreeDataViewController

@synthesize dataArray = _dataArray;
@synthesize webviewDic = _webviewDic;
@synthesize treeData = _treeData;
@synthesize functionA = _functionA;
@synthesize mTableView;
@synthesize style;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.title = @"选择对象";
        //创建一个右边按钮
        if(self.style == SelectMulti){
            UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"确定" style:UIBarButtonItemStyleDone target:self action:@selector(confirmButtonEvent:)];
            self.navigationItem.rightBarButtonItem = rightButton;
        }
        
    }
    return self;
}

- (id)initWithStyle:(ThreeDataStyle)styles serviceParamet:(ServiceParametModel*)para
{
    self.style = styles;
    self.isLocalData = YES;
    self.para = para;
    return [super init];
}

- (id)initWithStyle:(ThreeDataStyle)styles treeData:(NSArray*)dataArray
{
    self.style = styles;
    self.isLocalData = YES;
    self.threeArray = [NSMutableArray arrayWithArray:dataArray];
    return [super init];
}

- (void)setWebViewTransmitData:(NSDictionary *)webviewDic
{
    NSDictionary *uplaodData = [webviewDic objectForKey:CSMonitorNodeDataKeyTreeMenu];
    NSString *type = [uplaodData objectForKey:CSMonitorNodeOrderTreeMenuType];
    NSString *treeData = [uplaodData objectForKey:CSMonitorNodeOrderTreeMenuTreeData];
    NSString *functionA = [uplaodData objectForKey:CSMonitorNodeOrderTreeMenuFunctionA];
    
    self.webviewDic = webviewDic;
    self.style = [type intValue];
    self.treeData = treeData;
    self.functionA = functionA;
}

- (void)viewDidLoad
{
	[super viewDidLoad];
    self.mTableView.tableFooterView = [[UIView alloc] init];
    
    if (self.isLocalData && self.threeArray) {
        [self analysisLocalData:self.threeArray];
    } else if (self.isLocalData && !self.threeArray) {
        [self createNetWorkData:self.para];
    } else {
       [self analysisJsonStringToArray:_treeData];
    }
    
}

- (void)dealloc
{
    _dataArray = nil;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma 网络获取数据

- (void)createNetWorkData:(ServiceParametModel*)para
{
    CGFloat width = self.view.frame.size.width;
    CGFloat height = self.view.frame.size.height - self.view.frame.origin.x;
    
    self.indicatoView=[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
    _indicatoView.center = CGPointMake(width/2, height/2);
    _indicatoView.activityIndicatorViewStyle=UIActivityIndicatorViewStyleGray;
    //_indicatoView.hidesWhenStopped = YES;
    [self.view addSubview:_indicatoView];
    
    self.promptButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, width, height)];
    [_promptButton setTitle:@"加载失败，点击重试" forState:UIControlStateNormal];
    [_promptButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    _promptButton.titleLabel.font = [UIFont systemFontOfSize:16];
    [_promptButton addTarget:self action:@selector(promptSender:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_promptButton];
    
    //获取网络数据
    [self getApplyClassNetWorkData:para];
}

- (void)promptSender:(id)sender
{
    //获取合同数据
    [self getApplyClassNetWorkData:self.para];
}

- (void)getApplyClassNetWorkData:(ServiceParametModel*)para
{
    self.promptButton.hidden = YES;
    self.indicatoView.hidden = NO;
    [self.indicatoView startAnimating];
    
    ServiceConnect *content = [[ServiceConnect alloc] initWithMethodName:self.para.methodName dataArray:self.para];
    [content startConnectNetworkCompleted:^(ServiceResultModel *result, NSDictionary *userInfo) {
        //添加数据，刷新页面
        if (result.resultArray && result.resultArray.count>0) {
            self.threeArray = [NSMutableArray arrayWithArray:result.resultArray];
            [self analysisLocalData:self.threeArray];
        } else {
            self.promptButton.hidden = NO;
            [self.mTableView reloadData];
        }
        self.indicatoView.hidden = YES;
        [self.indicatoView stopAnimating];
        
    } failed:^(NSError *error, NSDictionary *userInfo) {
        NSLog(@"=====%@",error);
        self.promptButton.hidden = NO;
        self.indicatoView.hidden = YES;
        [self.indicatoView stopAnimating];
        [self.mTableView reloadData];
        
    } abnormal:^(NSError *error, NSDictionary *userInfo) {
        NSLog(@"=====%@",error);
        self.promptButton.hidden = NO;
        self.indicatoView.hidden = YES;
        [self.indicatoView stopAnimating];
        [self.mTableView reloadData];
    }];
}

#pragma 本地数据

- (void)analysisLocalData:(NSArray*)localData
{
    if (!localData) return;
    NSMutableArray *mutArray = [NSMutableArray arrayWithArray:localData];
    
    NSMutableArray *dataPath = [NSMutableArray arrayWithCapacity:0];
    NSMutableArray *array = [self showDataDispose:0 dataPath:dataPath localData:mutArray];
    
    _dataArray = array;
    [mTableView reloadData];
}

- (NSMutableArray*)showDataDispose:(int)level dataPath:(NSMutableArray*)dataPath localData:(NSMutableArray*)localData
{
    for (int i=0; i<localData.count; i++) {
        NSDictionary *dictionary = [localData objectAtIndex:i];
        NSMutableDictionary *mDictionary = [[NSMutableDictionary alloc] initWithDictionary:dictionary];
        
        [mDictionary setObject:[NSNumber numberWithInt:level] forKey:@"level"];
        [mDictionary setObject:[NSNumber numberWithBool:NO] forKey:@"expanded"];
        [mDictionary setObject:[dictionary objectFormatStringForKey:@"name"] forKey:@"nodeName"];
        
        NSArray *array = (NSArray*)[dictionary objectFormatForKey:@"Thelower"];
        if(array) {
            [mDictionary setObject:[NSNumber numberWithBool:NO] forKey:@"isNodeCheck"];
            NSMutableArray *mutArray = [NSMutableArray arrayWithArray:array];
            [mDictionary setObject:mutArray forKey:@"nodeChildList"];
        } else {
            [mDictionary setObject:[NSNumber numberWithBool:YES] forKey:@"isNodeCheck"];
        }
        
        NSMutableArray *newDataPath = [[NSMutableArray alloc] initWithCapacity:0];
        [newDataPath addObjectsFromArray:dataPath];
        [newDataPath addObject:[NSNumber numberWithInt:i]];
        [mDictionary setObject:newDataPath forKey:@"dataPath"];
        
        [localData insertObject:mDictionary atIndex:i];
        [localData removeObject:dictionary];
        
        NSMutableArray *temArray = [mDictionary objectForKey:@"nodeChildList"];
        if(temArray){
            [self showDataDispose:(level + 1) dataPath:newDataPath localData:temArray];
        }
    }
    
    NSMutableArray *array = [[NSMutableArray alloc] initWithArray:localData];
    return array;
}

#pragma 网页数据

- (void)analysisJsonStringToArray:(NSString*)jsonString
{
    if (!jsonString) return;
    NSData *dataDecrypt = [GTMBase64 decodeString:jsonString];
    NSArray *jaonArray = [NSJSONSerialization JSONObjectWithData:dataDecrypt
                                                                options:NSJSONReadingMutableContainers error:nil];
    
    NSMutableArray *dataPath = [NSMutableArray arrayWithCapacity:0];
    NSMutableArray *array = [self showDataDisposeLevel:0 dataPath:dataPath jsonArray:jaonArray];
    
    _dataArray = array;
    [mTableView reloadData];
}

//将原始数据进行处理
- (NSMutableArray*)showDataDisposeLevel:(int)level dataPath:(NSMutableArray*)dataPath jsonArray:(NSArray*)jsonArray
{
    for (int i=0; i<jsonArray.count; i++) {
        NSMutableDictionary *mDictionary = [jsonArray objectAtIndex:i];
        
        [mDictionary setObject:[NSNumber numberWithInt:level] forKey:@"level"];
        [mDictionary setObject:[NSNumber numberWithBool:NO] forKey:@"expanded"];
        
        NSMutableArray *newDataPath = [[NSMutableArray alloc] initWithCapacity:0];
        [newDataPath addObjectsFromArray:dataPath];
        [newDataPath addObject:[NSNumber numberWithInt:i]];
        [mDictionary setObject:newDataPath forKey:@"dataPath"];
        
        if (![[mDictionary objectForKey:@"isNodeCheck"] boolValue]) {
            NSMutableArray *temArray = [mDictionary objectForKey:@"nodeChildList"];
            [self showDataDisposeLevel:(level + 1) dataPath:newDataPath jsonArray:temArray];
        }
    }
    
    NSMutableArray *array = [[NSMutableArray alloc] initWithArray:jsonArray];
    return array;
}

#pragma mark -
#pragma mark - UITableViewDelegate

// Customize the number of sections in the table view.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
	return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
	return [_dataArray count];
}

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"ThreeDataViewCell";
    ThreeDataViewCell *cell = (ThreeDataViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[ThreeDataViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
	
    NSDictionary *Dictionary = [_dataArray objectAtIndex:indexPath.row];
	cell.titleLabel.text=[Dictionary valueForKey:@"nodeName"];
	[cell setIndentationLevel:[[Dictionary valueForKey:@"level"] intValue]];
    
    cell.checkButton.tag = indexPath.row;
    [cell.checkButton setStateChangedTarget:self selector:@selector(checkBoxViewChangedState:)];
    NSNumber *isCheck = [Dictionary objectForKey:@"isCheck"];
    [cell.checkButton setChecked:[isCheck boolValue]];
    
    BOOL isNodeCheck = [[Dictionary valueForKey:@"isNodeCheck"] boolValue];
    if (isNodeCheck) cell.iconButton.hidden = YES;
    else cell.iconButton.hidden = NO;
    
    BOOL isExpanded = [[Dictionary valueForKey:@"expanded"] boolValue];
    if (isExpanded) [cell.iconButton setImage:[UIImage imageNamed:@"Close.png"] forState:UIControlStateNormal];
    else [cell.iconButton setImage:[UIImage imageNamed:@"Open.png"] forState:UIControlStateNormal];
    
    if (style == SelectOne) {
        cell.checkButton.hidden = YES;
        [cell.checkButton setUserInteractionEnabled:NO];
    }
	
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
	[tableView deselectRowAtIndexPath:indexPath animated:YES];
	NSMutableDictionary *d=[self.dataArray objectAtIndex:indexPath.row];
    BOOL isExpanded = ![[d objectForKey:@"expanded"] boolValue];
    
    ThreeDataViewCell *cell = (ThreeDataViewCell*)[tableView cellForRowAtIndexPath:indexPath];
    if (isExpanded) [cell.iconButton setImage:[UIImage imageNamed:@"Close.png"] forState:UIControlStateNormal];
    else [cell.iconButton setImage:[UIImage imageNamed:@"Open.png"] forState:UIControlStateNormal];
    
    [d setObject:[NSNumber numberWithBool:isExpanded] forKey:@"expanded"];
    NSArray *ar=[d valueForKey:@"nodeChildList"];
    
    BOOL isNodeCheck = [[d objectForKey:@"isNodeCheck"] boolValue];
    
	if(ar && ar.count>0) {
		BOOL isAlreadyInserted=NO;
		for(NSDictionary *dInner in ar ){
			NSInteger index=[self.dataArray indexOfObjectIdenticalTo:dInner];
			isAlreadyInserted=(index>0 && index!=NSIntegerMax);
			if(isAlreadyInserted) break;
		}
		
		if(isAlreadyInserted) {
			[self miniMizeThisRows:ar];
		} else {
			NSUInteger count=indexPath.row+1;
			NSMutableArray *arCells=[NSMutableArray array];
			for(NSMutableDictionary *dInner in ar ) {
				[arCells addObject:[NSIndexPath indexPathForRow:count inSection:0]];
				[self.dataArray insertObject:dInner atIndex:count++];
			}
			[tableView insertRowsAtIndexPaths:arCells withRowAnimation:UITableViewRowAnimationLeft];
		}
	} else if(style == SelectOne && isNodeCheck) {
        //关闭页面
        if (self.backResultDelagate){
            if([self.backResultDelagate respondsToSelector:@selector(backResultDataKey:sender:dataValue:)])
            [self.backResultDelagate backResultDataKey:self.key sender:self.sender dataValue:d];
            
            if ([self.backResultDelagate respondsToSelector:@selector(backResultDataKey:dataValue:)])
                [self.backResultDelagate backResultDataKey:self.key dataValue:d];
        }
        [self.navigationController popViewControllerAnimated:YES];
    }
}

-(void)miniMizeThisRows:(NSArray*)array
{
	for(NSMutableDictionary *dInner in array ) {
		NSUInteger indexToRemove=[self.dataArray indexOfObjectIdenticalTo:dInner];
		NSArray *arInner=[dInner valueForKey:@"nodeChildList"];
		if(arInner && [arInner count]>0){
			[self miniMizeThisRows:arInner];
		}
		
		if([self.dataArray indexOfObjectIdenticalTo:dInner]!=NSNotFound) {
			[self.dataArray removeObjectIdenticalTo:dInner];
			[self.mTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:
                                   [NSIndexPath indexPathForRow:indexToRemove inSection:0]]
                                   withRowAnimation:UITableViewRowAnimationRight];
		}
	}
}

#pragma mark -
#pragma mark IBAction Event

- (IBAction) checkBoxViewChangedState:(SSCheckBoxView *)cbv
{
    NSNumber *isCheck = [NSNumber numberWithBool:cbv.checked];
    NSMutableDictionary *mDictionary = [_dataArray objectAtIndex:cbv.tag];
    
    /***************标记节点*******************/
    if ([isCheck boolValue]) {
        //父节点数据全部标记选中
        NSArray *pathArray = [mDictionary objectForKey:@"dataPath"];
        NSMutableArray *tempArrayData = _dataArray;
        for (NSInteger i=0; i<pathArray.count; i++) {
            int path = [[pathArray objectAtIndex:i] intValue];
            NSMutableDictionary *mDictionary = [tempArrayData objectAtIndex:path];
            [mDictionary setObject:[NSNumber numberWithBool:YES] forKey:@"isCheck"];
            tempArrayData = [mDictionary objectForKey:@"nodeChildList"];
        }
        
    } else {
       /***************取消标记节点*******************/
        //父节点数据全部标记取消
        NSArray *pathArray = [mDictionary objectForKey:@"dataPath"];
        for (NSInteger i=pathArray.count-2; i>=0; i--) {
            NSMutableDictionary *fDictionary = [self getAppointNodeDataArray:pathArray pathIndex:(int)i];
            NSMutableArray *tempArrayData = [fDictionary objectForKey:@"nodeChildList"];
            int markIndex = 0;
            
            for (NSMutableDictionary *temsDictionary in tempArrayData) {
                BOOL isCheck = [[temsDictionary objectForKey:@"isCheck"] boolValue];
                markIndex += isCheck ? 1 : 0;
            }
            
            if (markIndex>1) break;
            else [fDictionary setObject:[NSNumber numberWithBool:NO] forKey:@"isCheck"];
        }
    }
    
    //子节点数据全部标记选中或取消
    [mDictionary setObject:isCheck forKey:@"isCheck"];
    NSMutableArray *newArrayData = [mDictionary objectForKey:@"nodeChildList"];
    [self checkBoxViewSetValue:newArrayData check:isCheck];
    
    [mTableView reloadData];
}

- (NSMutableDictionary*) getAppointNodeDataArray:(NSArray *)pathArray pathIndex:(int)pathIndex
{
    NSMutableArray *tempArrayData = _dataArray;
    NSMutableDictionary *mDictionary = nil;
    for (int i=0; i<=pathIndex; i++) {
        int path = [[pathArray objectAtIndex:i] intValue];
        mDictionary = [tempArrayData objectAtIndex:path];
        tempArrayData = [mDictionary objectForKey:@"nodeChildList"];
    }
    
    return mDictionary;
}

- (void) checkBoxViewSetValue:(NSMutableArray*)newArrayData check:(NSNumber*)isCheck
{
    //子节点数据全部标记选中
    for(NSMutableDictionary *mDictionary in newArrayData){
        [mDictionary setObject:isCheck forKey:@"isCheck"];
        NSMutableArray *newArray = [mDictionary objectForKey:@"nodeChildList"];
        [self checkBoxViewSetValue:newArray check:isCheck];
    }
}

- (IBAction)confirmButtonEvent:(id)sender
{
    if (self.isLocalData) [self handleLocalSelectData];
    else [self handleWebViewSelectData];
}

//处理网页数据
- (void)handleWebViewSelectData
{
    if (!(_dataArray && _dataArray.count>0)) return;
    NSMutableArray *array = [[NSMutableArray alloc] initWithArray:_dataArray];
    [array removeObjectsInRange:NSMakeRange(1, _dataArray.count - 1)];
    
    NSMutableString *valueInfo = [[NSMutableString alloc] init];
    [self processBackData:array backArray:valueInfo];
    if(valueInfo.length>0) [valueInfo deleteCharactersInRange:NSMakeRange(valueInfo.length-1, 1)];
    
    if (valueInfo.length<=0) {
        UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"温馨提示" message:@"您没有选择任何对象，请选择对象"
                                                     delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil];
        alert.alertViewStyle=UIAlertViewStyleDefault;
        [alert show];
        return;
    }
    
    //获取原始数据
    NSString *newTreeData = [self getRemoveObjectForKeyJsonInfo:array];
    
    //返回结果处理
    NSMutableArray *resultArray = [[NSMutableArray alloc] init];
    [resultArray addObject:valueInfo];
    [resultArray addObject:newTreeData];
    [resultArray addObject:_functionA];
    
    if (self.backResultDelagate && [self.backResultDelagate respondsToSelector:@selector(backResultDataKey:dataValue:)])
        [self.backResultDelagate backResultDataKey:self.key dataValue:resultArray];
    [self.navigationController popViewControllerAnimated:YES];
}

//处理本地数据
- (void)handleLocalSelectData
{
    if (!(_dataArray && _dataArray.count>0)) return;
    NSMutableArray *array = [[NSMutableArray alloc] initWithArray:_dataArray];
    [array removeObjectsInRange:NSMakeRange(1, _dataArray.count - 1)];
    
    NSMutableArray *resultArray = [NSMutableArray array];
    [self processLocalBackData:array backArray:resultArray];
    
    if (self.backResultDelagate && [self.backResultDelagate respondsToSelector:@selector(backResultDataKey:dataValue:)])
        [self.backResultDelagate backResultDataKey:self.key dataValue:resultArray];
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)processLocalBackData:(NSMutableArray*)mArray backArray:(NSMutableArray*)valueInfo
{
    for (NSMutableDictionary *mDictionary in mArray) {
        NSNumber *isCheck = [mDictionary objectForKey:@"isCheck"];
        NSNumber *isNodeCheck = [mDictionary objectForKey:@"isNodeCheck"];
        
        NSMutableArray *newArrayData = [mDictionary objectForKey:@"nodeChildList"];
        if (newArrayData && newArrayData.count>0) {
            [self processLocalBackData:newArrayData backArray:valueInfo];
        } else if ([isCheck boolValue] && [isNodeCheck boolValue]) {
            [valueInfo addObject:mDictionary];
        }
    }
}

//得到选中的结果
- (void)processBackData:(NSMutableArray*)mArray backArray:(NSMutableString*)valueInfo
{
    for (NSMutableDictionary *mDictionary in mArray) {
        NSNumber *isCheck = [mDictionary objectForKey:@"isCheck"];
        NSNumber *isNodeCheck = [mDictionary objectForKey:@"isNodeCheck"];
        
        NSMutableArray *newArrayData = [mDictionary objectForKey:@"nodeChildList"];
        if (newArrayData && newArrayData.count>0) {
            [self processBackData:newArrayData backArray:valueInfo];
        } else if ([isCheck boolValue] && [isNodeCheck boolValue]) {
            NSString *value = [mDictionary objectForKey:@"nodeValue"];
            [valueInfo appendFormat:@"%@,",value];
        }
    }
}

//将现有数据生成原有数据
- (NSString*) getRemoveObjectForKeyJsonInfo:(NSMutableArray*)array
{
    //获取到原始数据
    [self getRemoveObjectForKeyData:array];
    
    //数据解析及生成
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:array
                                                       options:NSJSONWritingPrettyPrinted error:nil];
    NSData *newJsonBas4Data = [GTMBase64 encodeData:jsonData];
    NSString *treeBas4String = [[NSString alloc] initWithData:newJsonBas4Data encoding:NSUTF8StringEncoding];
    
    NSMutableDictionary *newWebviewDic = [[NSMutableDictionary alloc] initWithDictionary:_webviewDic];
    NSMutableDictionary *uplaodData = [newWebviewDic objectForKey:CSMonitorNodeDataKeyTreeMenu];
    
    NSMutableDictionary *newUplaodData = [[NSMutableDictionary alloc] initWithDictionary:uplaodData];
    [newUplaodData setObject:treeBas4String forKey:CSMonitorNodeOrderTreeMenuTreeData];
    [newWebviewDic removeObjectForKey:CSMonitorNodeDataKeyTreeMenu];
    [newWebviewDic setObject:newUplaodData forKey:CSMonitorNodeDataKeyTreeMenu];
    
    NSData *newJsonData = [NSJSONSerialization dataWithJSONObject:newWebviewDic
                                                          options:NSJSONWritingPrettyPrinted error:nil];
    NSData *newBaseData = [GTMBase64 encodeData:newJsonData];
    NSString *tempTreestring = [[NSString alloc] initWithData:newBaseData encoding:NSUTF8StringEncoding];
    NSString *newTreeData = [NSString stringWithFormat:@"js-calls://%@",tempTreestring];
    
    return newTreeData;
}

//获取到原始数据
- (void)getRemoveObjectForKeyData:(NSMutableArray*)oldArray
{
    for (NSMutableDictionary *mDictionary in oldArray) {
        [mDictionary removeObjectForKey:@"level"];
        [mDictionary removeObjectForKey:@"expanded"];
        [mDictionary removeObjectForKey:@"dataPath"];
        
        NSNumber *isNodeCheck = [mDictionary objectForKey:@"isNodeCheck"];
        if (![isNodeCheck boolValue]) {
            NSMutableArray *newArrayData = [mDictionary objectForKey:@"nodeChildList"];
            [self getRemoveObjectForKeyData:newArrayData];
        }
    }
}


@end
